import request from '@/router/axios'

export function fetchList(query) {
  return request({
    url: '/stm/swstinvoicexaztcheck/page',
    method: 'get',
    params: query
  })
}

export function addObj(obj) {
  return request({
    url: '/stm/swstinvoicexaztcheck',
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return request({
    url: '/stm/swstinvoicexaztcheck/' + id,
    method: 'get'
  })
}

export function delObj(id) {
  return request({
    url: '/stm/swstinvoicexaztcheck/' + id,
    method: 'delete'
  })
}

export function putObj(obj) {
  return request({
    url: '/stm/swstinvoicexaztcheck',
    method: 'put',
    data: obj
  })
}

// 查询前一月盘点数据
export function getPreviousMonthInvoiceXaztCheck(date) {
  return request({
    url: '/stm/swstinvoicexaztcheck/getPreviousMonthInvoiceXaztCheck?checkTime='+date,
    method: 'get'
  })
}

// 查询西安中铁定额发票盘点非驳回数据
export function getInvoiceXaztCheck(date) {
  return request({
    url: '/stm/swstinvoicexaztcheck/getInvoiceXaztCheck?checkTime='+date,
    method: 'get'
  })
}

export function getInvoiceXaztCheckEdit(id, date) {
  return request({
    url: '/stm/swstinvoicexaztcheck/getInvoiceXaztCheckEdit?id='+id+"&checkTime="+date,
    method: 'get'
  })
}

// 获取西安中铁定额发票盘点日期
export function getTypeValue(query) {
  return request({
    url: '/admin/dict/type/pettymoney_check_day',
    method: 'get',
    params: query
  })
}

// 新增或保存西安中铁定额发票盘点数据
export function saveOrUpdate(query) {
  return request({
    url: "/stm/swstinvoicexaztcheck/saveOrUpdate",
    method: "post",
    data: query
  });
}

// 提交
export function submitObj(obj) {
  return request({
    url: '/stm/swstinvoicexaztcheck/modify/submit/status',
    method: 'put',
    params: obj
  })
}

// 批量删除
export function batchDelete(ids) {
  return request({
    url: '/stm/swstinvoicexaztcheck/batchDelete',
    method: 'post',
    data: ids
  })
}

// 中心站长审核
export function approvalObj(obj) {
  return request({
    url: '/stm/swstinvoicexaztcheck/modify/approval/status',
    method: 'put',
    params: obj
  })
}

// 中心站长驳回
export function rejectObj(obj) {
  return request({
    url: '/stm/swstinvoicexaztcheck/modify/reject/status',
    method: 'put',
    params: obj
  })
}

// 导出
export function exportExcel(query) {
  return request({
    url: "/stm/swstinvoicexaztcheck/exportInvoiceXaztCheckForStation",
    method: "post",
    data: query,
    responseType: "blob",
    headers: {
      "Content-Type": "application/json;charset=UTF-8"
    }
  });
}

